home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 5 / BBS in a Box -Volume V (BBS in a Box) (April 1992).iso / Files / Hyper / M-Md / MAXAPPLZONE.cpt / MaxApplZone.c next >
Encoding:
C/C++ Source or Header  |  1988-11-24  |  1.5 KB  |  53 lines  |  [TEXT/KAHL]

  1. /* MaxApplZone.c */
  2.  
  3. /*    MaxApplZone XFCN for HyperCard
  4.     with LightSpeedC v. 3.01 - 11/2/88
  5.                                                     Copyright 1988 by
  6.     Returns the number of KB free space in            Sam Thornton
  7.     the HyperCard application heap and/or            PO Box 123
  8.     compacts the application heap.                    Fairfield NE 68938
  9.                                                     Some portions Copyright
  10.                                                     by Symantec and Apple.
  11.     See MaxApplZone.docs for user interface
  12.                                                     Compuserve: 71750,667
  13.                                                     GEnie: S.THORNTON5
  14.                                                     
  15.     NOTE:  All 'StringPtr' types in                    May be copied and
  16.            HyperXCmd.h and glue should                distributed for personal
  17.            be dereferenced to type 'Ptr'            use without charge only,
  18.            for this to compile properly.            except for nominal
  19.                                                     distribution fees. For
  20.                                                     commercial use or
  21.                                                     distribution, contact
  22.                                                     author, above.     */
  23. #include "HyperXCmd.h"
  24. #include "SetUpA4.h"
  25. #include "MemoryMgr.h"
  26. #include "unix.h"
  27.  
  28. typedef struct trade_mark {
  29.     char    mk[90];
  30.     } trade_mark;
  31.     
  32. trade_mark mrk = {" MaxApplZone XFCN v1.0 Copyright 1988 by Sam Thornton * PO Box 123 * Fairfield NE 68938 "};
  33.  
  34. pascal void main (paramPtr) 
  35.   XCmdBlockPtr paramPtr;
  36.   {
  37.       Size    grow;
  38.       int        mem_size;
  39.       
  40.     RememberA0();
  41.     SetUpA4();
  42.     
  43.     if (paramPtr->paramCount >= 1) { /* if any params, compact memory */
  44.         MaxMem(&grow);
  45.         MaxApplZone();
  46.         }
  47.     mem_size = (TheZone->zcbFree) / 1024;
  48.     paramPtr->returnValue = NewHandle(10);
  49.     stci_d(*paramPtr->returnValue,mem_size,9);
  50.         
  51.     RestoreA4();
  52.     return;
  53.     }